package lyj.springcloud.blockhandler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.lyj.springcloud.entities.CommonResult;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 全局的超出sentinel配置的降级处理
 */
@Component
public class MyBlockHandler {
    public static CommonResult fallBack_method_1(@PathVariable("id") String id, BlockException blockException){
        return new CommonResult("200" , "MyBlockHandler fallBack_method_1 ---- id " + id + ">>> " + blockException.getMessage());
    }
}
